home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import java.util.Vector;
- import symjava.sql.SQLException;
-
- public class Entity extends ServerObject {
- Vector _attribs = new Vector();
- int _count;
- Vector _attribNames = new Vector();
-
- Entity() {
- }
-
- int getType() {
- return 64;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- in.readShort();
- this._count = in.readShort();
- if (this._count > 0) {
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() != 54) {
- throw new SQLException("Object Stream error in Entity object");
- }
-
- this._attribs = ((ServerList)obj).getObjVector();
- this._count = this._attribs.size();
- this._attribNames = new Vector(this._count);
-
- for(int i = 1; i <= this._count; ++i) {
- this._attribNames.addElement(this.getColumnName(i));
- }
- }
-
- }
-
- void write(DataOutputStream out) throws IOException {
- throw new IOException("Write not permitted on Entity object");
- }
-
- Attribute getAttribute(int column) throws SQLException {
- if (column >= 1 && column <= this._count) {
- return (Attribute)this._attribs.elementAt(column - 1);
- } else {
- throw new SQLException("Column index out of range");
- }
- }
-
- public Vector getColumnList() throws SQLException {
- return this._attribNames;
- }
-
- public int getColumnCount() throws SQLException {
- return this._count;
- }
-
- public boolean isAutoIncrement(int column) throws SQLException {
- return this.getAttribute(column).isAutoIncrement();
- }
-
- public boolean isCaseSensitive(int column) throws SQLException {
- return this.getAttribute(column).isCaseSensitive();
- }
-
- public boolean isSearchable(int column) throws SQLException {
- return this.getAttribute(column).isSearchable();
- }
-
- public boolean isCurrency(int column) throws SQLException {
- return this.getAttribute(column).isCurrency();
- }
-
- public int isNullable(int column) throws SQLException {
- return this.getAttribute(column).isNullable();
- }
-
- public boolean isSigned(int column) throws SQLException {
- return this.getAttribute(column).isSigned();
- }
-
- public int getColumnDisplaySize(int column) throws SQLException {
- return this.getAttribute(column).getColumnDisplaySize();
- }
-
- public String getColumnLabel(int column) throws SQLException {
- return this.getAttribute(column).getColumnLabel();
- }
-
- public String getColumnName(int column) throws SQLException {
- return this.getAttribute(column).getColumnName();
- }
-
- public String getSchemaName(int column) throws SQLException {
- return this.getAttribute(column).getSchemaName();
- }
-
- public int getPrecision(int column) throws SQLException {
- return this.getAttribute(column).getPrecision();
- }
-
- public int getScale(int column) throws SQLException {
- return this.getAttribute(column).getScale();
- }
-
- public String getTableName(int column) throws SQLException {
- return this.getAttribute(column).getTableName();
- }
-
- public String getCatalogName(int column) throws SQLException {
- return this.getAttribute(column).getCatalogName();
- }
-
- public int getColumnType(int column) throws SQLException {
- return this.getAttribute(column).getColumnType();
- }
-
- public String getColumnTypeName(int column) throws SQLException {
- return this.getAttribute(column).getColumnTypeName();
- }
-
- public boolean isReadOnly(int column) throws SQLException {
- return this.getAttribute(column).isReadOnly();
- }
-
- public boolean isWritable(int column) throws SQLException {
- return this.getAttribute(column).isWritable();
- }
-
- public boolean isDefinitelyWritable(int column) throws SQLException {
- return this.getAttribute(column).isDefinitelyWritable();
- }
- }
-